﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Modeling;
using System.Diagnostics;

namespace DSLFactory.VSCTDesigner
{
    [RuleOn(typeof(Combo), FireTime = TimeToFire.TopLevelCommit)]
    class ComboAddRule : AddRule
    {
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            Combo combo = e.ModelElement as Combo;
            if( String.IsNullOrEmpty(combo.IdCommandList) )
            {
                combo.IdCommandList = combo.ID + "GetList";
            }
        }
    }
}
